﻿@model IEnumerable<_PLATFORM.DATA.GROUP>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            ORDER
        </th>
        <th>
            NAME
        </th>
        <th>
            IMAGE
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ORDER)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NAME)
        </td>
        <td>
            @{
               var imageName = item.IMAGE;
               var path = Url.Content("~/Assets/CategoryImages/" + imageName);
            }
            @Html.Image(path, item.NAME + " image.", new { style = "width:100px;height:75px;" })
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.GROUP_ID}) |
            @Html.ActionLink("Details", "Details", new { id = item.GROUP_ID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.GROUP_ID })
        </td>
    </tr>
}

</table>
